// pages/about1/about1.js//index.js
var app = getApp();
//引入这个插件，使html内容自动转换成wxml内容
var WxParse = require('../../wxParse/wxParse.js');
Page({
  data: {
    companyinfo:"",
    companylist:[]
  },
 
  //事件处理函数
  bindViewTap: function () {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },

  onLoad: function (option) {
    var that = this;
    that.loadDetail();
  },
  loadDetail: function () {
    var that = this;
    wx.request({
      url: app.d.hostUrl + '/common/get_companyintroduce',
      method: 'get',
      data: {},
      header: {
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        console.log(res);
        // --init data 
        var companylist = res.data.companylist;
        var companyinfo = res.data.companyinfo.conf_value;
        WxParse.wxParse('companyinfo', 'html', companyinfo, that, 0);
        that.setData({
          companylist: companylist,
        });
      },
      error: function (e) {
        wx.showToast({
          title: '网络异常！',
          icon:"none",
          duration: 2000,
        });
      },

    });
  },

  // 拨打电话
  opentel: function () {
    app.gotel();
  },

  /**
 * 用户点击右上角分享
 */
  onShareAppMessage: function () {
    var openid = wx.getStorageSync('openid');
    from: menu;
    return {
      title: '走吧商城',
      path: '/pages/onepage/onepage?openid=' + openid,
      success: function (res) {
        // console.log(openid);      
      },
      fail: function (res) {
        // console.log(res);
      }
    }
  },

})
